home *** CD-ROM | disk | FTP | other *** search
- /* getcrdir.c --- p. 602 */
- #include <stdio.h>
- #include <dir.h>
- main()
- {
- int cur_drive;
- char path[MAXPATH]; /* MAXPATH is defined in dir.h */
- /* First get the current drive */
- cur_drive =getdisk();
- /* Convert drive number to a letter */
- path[0] = cur_drive + 'A';
- path[1] = ':';
- path[2] = '\\';
- /* Now get the directory name to complete the path name */
- getcurdir(0, path+3);
- printf("Current path name is: %s\n", path);
- }
-